package com.store.orm.config;

/**
 * MySQL 配置解析对象
 * driver: 引擎, 默认 com.mysql.cj.jdbc.Driver
 * url: 将要连接的地址
 * username: 用户名
 * password: 密码
 * maxBatch: 批处理每次处理的数量, 默认 1000 条
 * logged: 是否开启日志记录, 默认开启
 * camelCase: 是否开启驼峰命名法, 默认开启
 * batchLog: 是否开启批处理日志记录, 默认关闭
 * truncate: 是否开启全表删除功能, 默认关闭
 * updateAll: 是否开启全表修改功能，默认关闭
 * pool: 连接池参数
 *
 * @author 宫静雨
 * @version 1.0
 */
public class MySQLConfig {

    private String driver = "com.mysql.cj.jdbc.Driver";
    private String url;
    private String username;
    private String password;
    private Integer maxBatch = 1000;
    private Boolean logged = true;
    private Boolean camelCase = true;
    private Boolean batchLog = false;
    private Boolean truncate = false;
    private Boolean updateAll = false;
    private Pool pool;

    public MySQLConfig() {
    }

    public Integer getMaxBatch() {
        return maxBatch;
    }

    public Boolean getUpdateAll() {
        return updateAll;
    }

    public void setUpdateAll(Boolean updateAll) {
        this.updateAll = updateAll;
    }

    public void setMaxBatch(Integer maxBatch) {
        this.maxBatch = maxBatch;
    }

    public Boolean getLogged() {
        return logged;
    }

    public void setLogged(Boolean logged) {
        this.logged = logged;
    }

    public Boolean getCamelCase() {
        return camelCase;
    }

    public void setCamelCase(Boolean camelCase) {
        this.camelCase = camelCase;
    }

    public Boolean getBatchLog() {
        return batchLog;
    }

    public void setBatchLog(Boolean batchLog) {
        this.batchLog = batchLog;
    }

    public Boolean getTruncate() {
        return truncate;
    }

    public void setTruncate(Boolean truncate) {
        this.truncate = truncate;
    }

    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Pool getPool() {
        return pool;
    }

    public void setPool(Pool pool) {
        this.pool = pool;
    }

    @Override
    public String toString() {
        return "MySQLConfig{" +
                "driver='" + driver + '\'' +
                ", url='" + url + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", maxBatch=" + maxBatch +
                ", logged=" + logged +
                ", camelCase=" + camelCase +
                ", batchLog=" + batchLog +
                ", truncate=" + truncate +
                ", updateAll=" + updateAll +
                ", pool=" + pool +
                '}';
    }
}